<?php
	// Доска объявлений (billboard)
	$posts = file('posts.txt');
	$comments = array();
	foreach($posts as $post) {
		$elems = explode("#", $post);
		$comments[] = array("nick" => $elems[0],
							"date" => $elems[1],
							"text" => $elems[2]);
	}
	//print_r($comments);
?>
<!DOCTYPE html> <!-- HTML 5.0 -->
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; 
								charset = cp1251" />
		<title>BillBoard</title>
	</head>
	<body>
	<h1>Welcome to BillBoard</h1>
	<? foreach($comments as $comment) {
			echo "<b>{$comment["nick"]}</b> - 
				  <i>{$comment["date"]}</i>
				  <br />
			      <p>{$comment["text"]}</p>
				  <hr>";
		}
	?>
		
	<form action="newpost.php" method="POST">
		Nick: <input type="textfield" name="nick" />
		<br />
		<textarea name="post"></textarea>
		<br />
		<input type="submit" value="Запостить" />
	</form>
	</body>
</html>